{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Requirement already satisfied: itchat in e:\\anaconda3\\lib\\site-packages\n",
      "Requirement already satisfied: requests in e:\\anaconda3\\lib\\site-packages (from itchat)\n",
      "Requirement already satisfied: pyqrcode in e:\\anaconda3\\lib\\site-packages (from itchat)\n",
      "Requirement already satisfied: pypng in e:\\anaconda3\\lib\\site-packages (from itchat)\n",
      "Requirement already satisfied: chardet<3.1.0,>=3.0.2 in e:\\anaconda3\\lib\\site-packages (from requests->itchat)\n",
      "Requirement already satisfied: idna<2.7,>=2.5 in e:\\anaconda3\\lib\\site-packages (from requests->itchat)\n",
      "Requirement already satisfied: urllib3<1.23,>=1.21.1 in e:\\anaconda3\\lib\\site-packages (from requests->itchat)\n",
      "Requirement already satisfied: certifi>=2017.4.17 in e:\\anaconda3\\lib\\site-packages (from requests->itchat)\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "You are using pip version 9.0.3, however version 18.0 is available.\n",
      "You should consider upgrading via the 'python -m pip install --upgrade pip' command.\n"
     ]
    }
   ],
   "source": [
    "!pip install itchat -i https://pypi.douban.com/simple"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "ename": "SyntaxError",
     "evalue": "invalid syntax (<ipython-input-5-28e36cf27e44>, line 6)",
     "output_type": "error",
     "traceback": [
      "\u001b[1;36m  File \u001b[1;32m\"<ipython-input-5-28e36cf27e44>\"\u001b[1;36m, line \u001b[1;32m6\u001b[0m\n\u001b[1;33m    apiUrl=\u001b[0m\n\u001b[1;37m           ^\u001b[0m\n\u001b[1;31mSyntaxError\u001b[0m\u001b[1;31m:\u001b[0m invalid syntax\n"
     ]
    }
   ],
   "source": [
    "import itchat\n",
    "import requests\n",
    "APIKEY=\"71ff8f70c7374d3794d3a556ba1383fe\"\n",
    "def get_response(msg):\n",
    "    #\n",
    "    apiUrl=\"\"\n",
    "    data={\"key\":APIKEY,\"msg\":msg,\"user-id\":\"fxdayu\"}\n",
    "    r=requests.post(apiUrl,data=data)\n",
    "    return response\n",
    "@itchat.msg_register(itchat.content.TEXT)\n",
    "def tuling_reply(msg):\n",
    "    reply = get_response(msg['Text'])\n",
    "    return reply\n",
    "itchat.auto_login(enableCmdQR=False)\n",
    "itchat.run()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "\n"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.4"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
